#include "Tools\Ref.h"
#include "Core\Item.h"
namespace SakuraAge {
void Reflection::addRef(std::pair<std::string, std::function<void*()>> p) {
  if (instance == nullptr) {
    instance = new Reflection();
  }
  instance->refs.insert(p);
}
void* Reflection::Create(std::string className) {
  if (instance) {
    auto ret = instance->refs.find(className);
    if (ret != instance->refs.end()) {
      return ret->second();
    }
  }
  return nullptr;
  // return instance->refs[className]();
}
Reflection* Reflection::instance;

}  // namespace SakuraAge